<template>
  <div id="app">
    
    <!-- <router-view/> -->
    <eheader></eheader>
    <div class="tab border-bottom">
      <div class="tab-item">
        <router-link :to="{name:'goods'}">商品</router-link>
      </div>
      <div class="tab-item">
        <router-link :to="{name:'details'}">评论</router-link>
      </div>
      <div class="tab-item">
        <router-link :to="{name:'seler'}">商家</router-link>
      </div>
    </div>
    <div class="content">
      <router-view></router-view>
    </div>
    <div>
      {{citylists}}
    </div>
  </div>
</template>

<script>
import axios from "axios";
import eheader from "./components/header/header";
export default {
  name: "App",
  components: {
    eheader: eheader
  },
  data() {
    return {
      citylists: "1"
    };
  },
  methods: {
    // 获取数据
    getdata: function() {
      var _this = this;
      axios
        .get("/api/data.json")
        .then(function(res) {
          console.log(res.data);
          var res = res.data;
          _this.citylists = res;
        })
        .catch(function(err) {
          console.log(err);
        });
    }
  },
  mounted() {
    this.getdata();
  }
};
</script>

<style scoped lang="less">
#app {
  .tab {
    display: flex;
    width: 100%;
    height: 40px;
    line-height: 40px;
    .tab-item {
      flex: 1;
      text-align: center;
      a {
        display: block;
        font-size: 14px;
        color: rgb(77, 85, 93);
      }
      .router-link-exact-active {
        color: brown;
      }
    }
  }
}
</style>
